<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.Item" %>
<%@ page import="com.fc.control.ItemControl" %>

<%
      request.setCharacterEncoding("utf-8");
      int itemId = ParamUtil.getInt(request,"id",0);
      int store_id = Integer.parseInt(request.getParameter("store_id"));
      String item_name = new String(request.getParameter("item_name").getBytes("iso8859-1"),"utf-8");
      Item item = new Item();
      item.setStore_id(store_id);
      item.setItem_name(item_name);
      boolean isSuccess = ItemControl.addItem(item);
      String returnJson = "{\"status\":\"" + (isSuccess ?  1 : 0) + "\"}";
 %>
 <%=returnJson %>
